package com.sxt.bus.controller;


import com.sxt.springcloud.bus.ProviderClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sxt.bus.vo.ProviderVo;
import com.sxt.sys.common.DataGridView;
import com.sxt.sys.common.ResultObj;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 老雷
 * @since 2019-09-27
 */
@RestController
@RequestMapping("/provider")
public class ProviderController {

	@Autowired
	private ProviderClientService providerClientService;

	/**
	 * 查询
	 */
	@RequestMapping("loadAllProvider")
	public DataGridView loadAllProvider(ProviderVo providerVo) {
		return this.providerClientService.loadAllProvider(providerVo);
	}

	/**
	 * 添加
	 */
	@RequestMapping("addProvider")
	public ResultObj addProvider(ProviderVo providerVo) {
		return this.providerClientService.addProvider(providerVo);
	}

	/**
	 * 修改
	 */
	@RequestMapping("updateProvider")
	public ResultObj updateProvider(ProviderVo providerVo) {
		return this.providerClientService.updateProvider(providerVo);
	}

	/**
	 * 删除
	 */
	@RequestMapping("deleteProvider")
	public ResultObj deleteProvider(Integer id) {
		return this.providerClientService.deleteProvider(id);
	}

	/**
	 * 批量删除
	 */
	@RequestMapping("batchDeleteProvider")
	public ResultObj batchDeleteProvider(ProviderVo providerVo) {
		return this.providerClientService.batchDeleteProvider(providerVo);
	}
	
	
	/**
	 * 加载所有可用的供应商
	 */
	@RequestMapping("loadAllProviderForSelect")
	public DataGridView loadAllProviderForSelect() {
		return this.providerClientService.loadAllProviderForSelect();
	}
}

